package com.bayihouse.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bayihouse.model.excel.publicClass.BaseOneEntity;
import com.bayihouse.model.excel.publicClass.father.BaseEntity;
import com.bayihouse.utils.MyObjectUtils;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName house
 */
@TableName(value = "house")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode
public class House extends BaseOneEntity<Unit> implements Serializable {

    /**
     * 探针数量
     */
    private Integer probeNum;

    /**
     * 该楼的其他详情
     */
    private String detail;



    /**
     * 所属小区
     */
    @TableField("father_id")
    private Long communityId;

    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public void setTId() {
        if (super.checkIsEmptyTList()) {
            return;
        }
        super.tlist.stream().forEach(child->{
            child.setHouseId(super.id);
        });
    }
}